Skip to content

Implemented io-uring Op<Statx> and applied to read_uring and fs::try_exists#8080

Merged
Daksh14 merged 11 commits into
tokio-rs:masterfrom
asder8215:io-uring-metadata
Jun 13, 2026
Merged

Implemented io-uring Op<Statx> and applied to read_uring and fs::try_exists#8080
Daksh14 merged 11 commits into
tokio-rs:masterfrom
asder8215:io-uring-metadata

Conversation

@asder8215

Copy link
Copy Markdown
Contributor

Motivation

This builds up on vrtgs PR in their attempt of implementing Statx for io-uring and apply it to fs::try_exists. I used libc instead of linux-raw-sys for the Statx implementation, tried to preserve more of how the original code (prior to vrtgs' changes) looked in certain files. There are some inlining done for the metadata functions for Statx because I thought the body of the code in these functions were pretty small and didn't seem to involve generics (let me know if I should remove that). Some other review comments mentioned in review of vrtgs' PR is addressed such as safety comments, inlining for the try_exists_uring, avoiding using CString literals, etc.

To note, this is my first time contributing to Tokio, so let me know if there's anything that I'm doing incorrectly or if I missed something as per procedure here. Let me know if I should also squash some commits as well.

ccing @Daksh14 since I got to working on this PR per him sharing vrtgs' PR with me.

Comment thread tokio/src/io/uring/statx.rs Outdated
@mattiapitossi mattiapitossi added A-tokio Area: The main tokio crate T-io-uring Topic: Linux io_uring M-fs Module: tokio/fs labels Apr 21, 2026
@asder8215 asder8215 force-pushed the io-uring-metadata branch 3 times, most recently from ff8130b to dd9a2c3 Compare April 21, 2026 23:14
@asder8215

asder8215 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

Any reason why libc statx constants are not found for Linux 7.0?

image

Comment thread tokio/src/fs/read.rs Outdated
@Darksonn

Darksonn commented Apr 23, 2026

Copy link
Copy Markdown
Member

The compilation error is probably related to whether the build is using gnu or musl libc. See rust-lang/rust#154981 with similar issue.

Comment thread tokio/src/fs/try_exists.rs Outdated
Comment thread tokio/src/io/uring/statx.rs
Comment thread tokio/src/fs/open_options.rs Outdated
Comment thread tokio/src/io/uring/utils.rs Outdated
Comment thread tokio/src/io/uring/statx.rs Outdated
@asder8215 asder8215 force-pushed the io-uring-metadata branch from b474ac9 to 4e5c5d3 Compare May 4, 2026 20:49
@asder8215 asder8215 requested review from Daksh14 and martin-g May 4, 2026 20:49
@asder8215 asder8215 force-pushed the io-uring-metadata branch from 4e5c5d3 to 0d20ca6 Compare May 4, 2026 20:57
Comment thread tokio/tests/fs_uring_statx.rs Outdated
Comment thread tokio/src/fs/try_exists.rs
@asder8215 asder8215 force-pushed the io-uring-metadata branch from f7932c4 to 1685fe0 Compare May 12, 2026 23:12
@asder8215 asder8215 requested a review from mattiapitossi May 17, 2026 20:27
Comment thread tokio/tests/fs_uring_statx.rs
Comment thread tokio/src/io/uring/statx.rs
@asder8215 asder8215 force-pushed the io-uring-metadata branch 2 times, most recently from 90a1824 to fcb9a10 Compare May 18, 2026 21:52
@asder8215 asder8215 requested a review from mattiapitossi May 18, 2026 22:59
Comment thread tokio/src/io/uring/statx.rs Outdated
@asder8215 asder8215 force-pushed the io-uring-metadata branch 2 times, most recently from 5183b76 to 5824fc1 Compare May 19, 2026 15:36
@asder8215 asder8215 requested a review from mattiapitossi May 19, 2026 15:36
@asder8215

Copy link
Copy Markdown
Contributor Author

Not sure what to make out of the failing check:

(node:1776) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Don't think that's due to this PR.

@asder8215 asder8215 requested review from Daksh14 and Darksonn May 31, 2026 06:35
Comment thread tokio/src/fs/read_uring.rs
Comment thread tokio/src/fs/open_options.rs
Comment thread tokio/src/io/uring/statx.rs
@asder8215 asder8215 force-pushed the io-uring-metadata branch 2 times, most recently from bd7c32f to 7a9e197 Compare June 12, 2026 14:00
@asder8215

Copy link
Copy Markdown
Contributor Author

Is there anything else in this PR that needs to be modified? Or does everything look good?

@asder8215 asder8215 force-pushed the io-uring-metadata branch from 7a9e197 to 9324bbe Compare June 12, 2026 15:17
vrtgs and others added 11 commits June 12, 2026 11:38
…hutdown, stating multiple files, ELOOP, ENAMETOOLONG, EACCES
…statx is supported on 1.25+ musl, and MSRV that uses 1.25 on all *-linux-musl platforms is 1.93
…ble on Linux <5.1, removed stat permission denied test case since it doesn't work on Linux 4.19
… in statx operation, use assert pending in cancel ops
…on platforms that don't support io_uring, removed unnecessary comments, and added TODO on symlink_metadata for when Metadata::from_statx is stabilized
… fd leak test, and removed cfg_io_uring gates (localized the feature gate to the pertinent part of the code that uses it in read_uring)
@asder8215 asder8215 force-pushed the io-uring-metadata branch from 9324bbe to 3a24159 Compare June 12, 2026 15:38
@Daksh14 Daksh14 enabled auto-merge (squash) June 13, 2026 17:07
@Daksh14 Daksh14 self-requested a review June 13, 2026 17:30
@Daksh14 Daksh14 merged commit 7892f60 into tokio-rs:master Jun 13, 2026
239 of 244 checks passed
@asder8215 asder8215 deleted the io-uring-metadata branch June 15, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate M-fs Module: tokio/fs T-io-uring Topic: Linux io_uring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants